package com.course.web.model;

import com.course.domain.model.TaskClass;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * Created by Justin on 2017/6/11.
 */
@Data
@EqualsAndHashCode(of = {"id"})
public class TaskClassVM implements HasID {
    @Min(0)
    private int id;
    @Min(0)
    private final int courseId;
    @NotEmpty
    private String title;
    @NotNull
    private TaskClass.Type classType;
    @Min(0)
    private int minutes;
    @NotEmpty
    private String detail;
    @NotEmpty
    private String pptLink;

    public String getType() {
        return classType.getTitle();
    }
}
